home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6072 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  885 b 

  1. Path: atglab.bls.com!usenet
  2. From: yzbjbpj@news
  3. Newsgroups: comp.lang.c
  4. Subject: Re: [Help] I can't find my error.
  5. Date: Thu, 22 Feb 96 08:31:04 cst
  6. Organization: BellSouth ATG lab
  7. Message-ID: <NEWTNews.825000870.11791.yzbjbpj@a0004005.al.bst.bls.com>
  8. References: <4ggvgr$1b2@aurora.engr.LaTech.edu>
  9. NNTP-Posting-Host: bstfirewall.bst.bls.com
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. char name should probably be a character array, e.g. char name[20];
  16. Make sure the array is large enough to hold the longest name that
  17. will be input.
  18.  
  19. By just declaring name as a char like you're doing, all
  20. that will be stored in name via scanf is the first letter typed in.  Also,
  21. the rest of the name input may cause the int age variable to be overwritten.
  22. So, be sure to use an array for name.
  23.  
  24. Brian 
  25.  
  26.